package nl.haemers.events 
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.events.Event;
	
	/**
	 * ...
	 * @author Jonathan Haemers
	 * @company Idreams
	 */
	public class ImageLoaderEvent extends Event 
	{
		public static const IMAGE_LOADED				:String = "imageLoaded";
		
		private var _imageData							:BitmapData;
		private var _image								:Bitmap;
		
		public function ImageLoaderEvent(type:String, imageData:BitmapData=null, image:Bitmap=null, bubbles:Boolean=false, cancelable:Boolean=false) 
		{ 
			super(type, bubbles, cancelable);
			
			_imageData = imageData;
			_image = image;
		} 
		
		public override function clone():Event 
		{ 
			return new ImageLoaderEvent(type, bubbles, cancelable);
		} 
		
		public override function toString():String 
		{ 
			return formatToString("ImageLoaderEvent", "type", "bubbles", "cancelable", "eventPhase"); 
		}
		
		public function get imageData() : BitmapData
		{ 
			return _imageData;
		}
		
		public function get image() : Bitmap
		{ 
			return _image;
		}
	}
	
}